package com.ctrip.demo.test;

import java.util.Arrays;

public class LeetCode217 {

    public static void main(String[] args) {
        containsDuplicate(new int[]{1,2,3,1});
    }

    public static boolean containsDuplicate(int[] nums) {
        Arrays.sort(nums);
        for (int i = 1; i < nums.length; i ++) {
            if(nums[i] == nums[i - 1]) {
                return true;
            }
        }
        return false;

    }
}
